1. Field of the Invention
The present invention relates generally to the field of computer graphics, in particular to systems and method for generating and rendering images in three-dimensional graphics. More particularly, the present invention relates to a system and method for generating three-dimensional objects to be rendered by a graphics subsystem.
2. Description of the Background Art
Rendering systems generate representations of objects using polygonal approximations. The level of detail and realism achieved in a 3D-representation is directly related to the number of polygons used to represent the object. However, objects having a large number of polygons are resource-intensive to process. Therefore, many conventional systems limit the number of polygons used to represent objects. In these systems, when the camera zooms closer to objects, the objects appear blocky, and lose their smooth edges. Additionally, in prior art systems, polygons are generated from mathematical surfaces by recursive subdivision. Thus, polygons of an object are subdivided with successive passes to produce a higher number of polygons and to eliminate any known artifacts caused by the subdivision. This process is also resource-intensive, and requires a longer processing cycle. Thus, a system, method, and apparatus is needed that dynamically adds detail to objects when more detail would be perceived by a human eye, and uses less detail when and where less detail is required, to optimize the appearance of 3D objects without wasting processing power. Additionally, a system, method, and apparatus are needed that eliminates recursive passing but still creates smooth accurate surfaces and eliminates artifacts generated by subdivision.
A system, method, and apparatus are provided to adaptively determine the amount and nature of polygons to be used to render objects in a 3D-environment. First, a control mesh of polygonal approximations is generated from one of a variety of conventional object representation schemes. The control mesh is a uniform representation of the object to be rendered comprising edge information and reconstruction data for the polygons comprising the control mesh. Reconstruction data includes surface normal data, and surface hint data. Surface hint data includes information regarding whether a vertex is a sharp point, or whether an edge should be represented as a hard edge. Next, resolution levels are calculated for all of the vertices of all polygons in the control mesh. Resolution levels specify the appropriate level of resolution for a triangle or other polygon responsive to the topology of the object and the camera angle currently being used in the application. Polygons representing areas of an object that are being viewed by the camera at an angle that reveals edges of the object are given higher resolution levels. However, polygons representing areas of an object that are being viewed by a camera at an angle that obscures edge information, for example, if the camera is viewing the area directly, are given lower resolution levels. Thus, the resolution of the object is dynamically, locally, and adaptively determined to provide higher levels of detail where detail is most apparent to the human eye, and less detail when detail would be unnoticed.
Responsive to calculating the resolution levels, the polygons are subdivided responsive to the resolution levels. However, conventional subdivision methodologies require multiple heuristic sweeps to identify and remedy any cracks or artifacts generated when two polygons share edges that are not subdivided identically (T-vertices). This known problem is addressed in conventional systems by repetitive analysis and correction that is resource-intensive and inefficient. However, in accordance with the present invention, a data structure is maintained that provides the appropriate subdivision methodology to be used for all cases of T-vertices caused by subdivision junctures of differing resolution. The data structure allows the processing to occur rapidly, effectively, and ensures that no cracks or artifacts will occur during subdivision. Thus, no repetitive looping or branching is required to identify cracks or artifacts in accordance with the present invention.
After subdivision, locations for the vertices of the new polygons are calculated. In accordance with the present invention, where the polygons being generated are triangles, Bezier triangular patches are used in place of the original triangles to provide a curved surface rendering that has a greater level of control. The parameters for the Bezier triangles are calculated from the known vertices and vertex attributes of the triangles, and the reconstruction data, to provide a detailed, realistic representation of the object. Thus, in accordance with a further embodiment of the present invention, additional detail can be added to an object from an original control mesh. In systems where polygonal approximations are received as an input, the added detail is new detail not present in the original object, thus providing for a rendered object that has more detail than the original. For other types of input, the final product is a very close approximation of the original surface. However, as the detail is added adaptively, the amount of detail is added as necessary to provide the most accurate image without wasting resources.